<?php
// no direct access
defined('_JEXEC') or die;
$baseurl = JURI::base();

if($headerText)
	echo $headerText;
?>
<style type="text/css">
	#slideshow {
		margin: 1px auto;
		position: relative;
		width: 199px;
		height: 336px;
	}

	#slideshow > li {
		position: absolute;
	}
	
	#slideshow > li > span {
		padding: 5px 0;
	}
</style>

<script type="text/javascript">
$(document).ready(function(){
	$("#slideshow > li:gt(0)").hide();

	setInterval(function() {
			$('#slideshow > li:first')
			.fadeOut(1000)
			.next()
			.fadeIn(1000)
			.end()
			.appendTo('#slideshow');
		}, 4000);
});
</script>

<ul id="slideshow" class="clearfix">
<?php
shuffle ( $list );//random order
foreach($list as $item):
	$link = JRoute::_('index.php?option=com_banners&task=click&id='. $item->id);
	$imageurl = $item->params->get('imageurl');
	$width = $item->params->get('width');
	$height = $item->params->get('height');
	$alt = $item->params->get('alt');
	$alt = $alt ? : $item->name ;
	$alt = $alt ? : JText::_('MOD_BANNERS_BANNER') ;
	if($item->clickurl):
		$target = $params->get('target', 1);
?>
<li>
			<img
					src="<?php echo $baseurl , $imageurl?>"
					alt="<?php echo $alt?>"
					<?php if (!empty($width)) echo 'width ="',$width,'"'?>
					<?php if (!empty($height)) echo 'height ="',$height,'"'?>
			/>
</li>
<?php else://end clickurl?>
<li>
	<span style="display:inline-block">
	<?php echo $item->name?>
	</span>
	<a
	href="http://www.fitplan.dk/component/content/article/default/27-fitplan-team" target="_blank"
	title="fitplan team">
			<img
				src="<?php echo $baseurl , $imageurl?>"
				alt="<?php echo $alt?>"
				width ="100%"
				<?php if (!empty($height)) echo 'height ="',$height,'"'?>
			/>
	</a>
	<span style="display:inline-block">
	<?php echo $item->description?>
	</span>
</li>
<?php endif;
endforeach?>
</ul>
<?php /*?>
<div class="form-wrapper">
	<a href="index.php?option=com_users&view=registration" class="btnImage" id="btnLogin2">Opret Bruger nu</a>
</div>
<?php */?>
<?php if($footerText)
	echo $footerText;
?>